package milkproduction.to;

public class ReleaseTO {
	private int releaseNo;
	private String releaseDate;
	private int orderNO;
	private OrderTO order;
	
	public ReleaseTO(){}

	public ReleaseTO(int releaseNo, String releaseDate, int orderNO,
			OrderTO order) {
		super();
		this.releaseNo = releaseNo;
		this.releaseDate = releaseDate;
		this.orderNO = orderNO;
		this.order = order;
	}

	public ReleaseTO(int releaseNo, String releaseDate, int orderNO) {
		super();
		this.releaseNo = releaseNo;
		this.releaseDate = releaseDate;
		this.orderNO = orderNO;
	}

	public int getReleaseNo() {
		return releaseNo;
	}

	public void setReleaseNo(int releaseNo) {
		this.releaseNo = releaseNo;
	}

	public String getReleaseDate() {
		return releaseDate;
	}

	public void setReleaseDate(String releaseDate) {
		this.releaseDate = releaseDate;
	}

	public int getOrderNO() {
		return orderNO;
	}

	public void setOrderNO(int orderNO) {
		this.orderNO = orderNO;
	}

	public OrderTO getOrder() {
		return order;
	}

	public void setOrder(OrderTO order) {
		this.order = order;
	}

	@Override
	public String toString() {
		return "ReleaseTO [releaseNo=" + releaseNo + ", releaseDate="
				+ releaseDate + ", orderNO=" + orderNO + ", order=" + order
				+ "]";
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((order == null) ? 0 : order.hashCode());
		result = prime * result + orderNO;
		result = prime * result
				+ ((releaseDate == null) ? 0 : releaseDate.hashCode());
		result = prime * result + releaseNo;
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ReleaseTO other = (ReleaseTO) obj;
		if (order == null) {
			if (other.order != null)
				return false;
		} else if (!order.equals(other.order))
			return false;
		if (orderNO != other.orderNO)
			return false;
		if (releaseDate == null) {
			if (other.releaseDate != null)
				return false;
		} else if (!releaseDate.equals(other.releaseDate))
			return false;
		if (releaseNo != other.releaseNo)
			return false;
		return true;
	}
	
	
}
